 #ifndef 	__HAL_INCHECK_H__
#define 	__HAL_INCHECK_H__
#include "main.h"
#include "LsdEvent.h"

//@7 错误的类型
//@7 修改这里时一定要修改函数配置表
typedef enum
{
	TYPE_PRESSURE_HIGH_CO2_SW=0,//高压CO2开关
	TYPE_WATER_HIGH_HEAT,   //热罐高
	TYPE_WATER_MID_HEAT,		//热罐中
	TYPE_WATER_LOW_HEAT,		//热罐低
	TYPE_WATER_HIGH_COOL,		//冷罐高
	TYPE_WATER_LOW_COOL,		//冷罐低
	TYPE_WATER_HIGH_SODA,		//苏达罐高
#if (DEV_HARD_VER<=10001) 
	ERROR_RES14=14,
#else
	TYPE_WATER_LOW_SODA,		//苏达罐低
	ERROR_RES13=13,
#endif	
	

	TYPE_INPUT_MAX

}teInputType;

	

typedef enum
{
	PRESS_LOW_OFF = 0,//闭合, 源水有水 
	PRESS_LOW_ON = 1, // 断开, 源水缺水 高电平是缺水
	
} tePressLowStatus;


//@7 开始和接收延迟的时间
typedef struct
{
	uint16_t start_keep;
	uint16_t end_keep;
}tsInputParam;

typedef union
{
	uint32_t value;
	struct
	{		
		uint32_t high_co2_sw:1; // 高压CO2开关  
		uint32_t water_heat_high:1; 	//热罐高
		uint32_t water_heat_mid:1;		//热罐中
		uint32_t water_heat_low:1;		//热罐低
		uint32_t water_cool_high:1; 	//冷罐高
		uint32_t water_cool_low:1;		//冷罐低
		uint32_t water_soda_high:1;		//苏达高
		uint32_t water_soda_low:1;		//苏达低
		uint32_t res1:24;
	} bits;
}tuIOStatus;


typedef struct
{
	uint32_t    timer[TYPE_INPUT_MAX];  //@7计数
	uint32_t 	  inst;   //@7指示
	tuIOStatus  conf;   //@7 确认  

}tsInputCtrl;

//@7 错误运行函数
typedef struct
{
	void 		  (*pfn_check)(void);
	void 			(*pfn_confirm)(uint32_t type);
	uint16_t  (*pfn_getstatus)(void); //获得状态
	uint16_t   polarity; //极性
}tsInputFunc;

void OnHalInCheck(void);  //1000ms
extern uint8_t OnGetIOStatus(uint32_t i);
#endif


